﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Diplom.NumericArrays;

namespace Diplom.Forms
{
    public partial class ArraySelectTypeOfLoad : Form
    {
        Numeric1DArray array = null;

        public ArraySelectTypeOfLoad()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ArrayDesigner arDesigner = new ArrayDesigner();
            if (arDesigner.ShowDialog() == DialogResult.OK)
            {
                array = new Numeric1DArray(arDesigner.Array);
                this.DialogResult = DialogResult.OK;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ArrayLoadFromFile arrayLoadFromFile = new ArrayLoadFromFile();
            if (arrayLoadFromFile.ShowDialog() == DialogResult.OK)
            {
                array = new Numeric1DArray(arrayLoadFromFile.GetArray());
                this.DialogResult = DialogResult.OK;
            }
        }

        public Numeric1DArray GetArray()
        {
            return array;
        }
    }
}
